package com.david.nacos.config.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author David
 * @version V1.0
 * @Package com.david.nacos.config.controller
 * @date 2021/5/16 15:48
 */
@RestController
@RequestMapping("/nacos/config")
public class DemoController {

    @NacosValue(value = "${com.david.test:null}",autoRefreshed = true)
    private String test;

    @RequestMapping("/getConfig")
    public String getConfig(){
        System.out.println("test = " + test);
        return test;
    }


}
